package emulator.assembler;

public class DataDescription {
	private int address;
	private boolean is_code;
	private boolean is_jump_target;
	private int access_count;
	private int length;
	
	public DataDescription(int address, int length)
	{
		assert(length > 0);
		this.address = address;
		this.length = length;
		is_code = false;
		is_jump_target = false;
		access_count = 0;
	}

	/**
	 * @return the is_code
	 */
	public boolean isCode() {
		return is_code;
	}

	/**
	 * @param is_code the is_code to set
	 */
	public void setIsCode(boolean is_code) {
		this.is_code = is_code;
	}

	/**
	 * @return the is_jump_target
	 */
	public boolean isJumpTarget() {
		return is_jump_target;
	}

	/**
	 * @param is_jump_target the is_jump_target to set
	 */
	public void setIsJumpTarget(boolean is_jump_target) {
		this.is_jump_target = is_jump_target;
	}

	/**
	 * @return the access_count
	 */
	public int getAccessCount() {
		return access_count;
	}

	/**
	 * @param access_count the access_count to set
	 */
	public void setAccessCount(int access_count) {
		this.access_count = access_count;
	}

	/**
	 * @return the address
	 */
	public int getAddress() {
		return address;
	}

	/**
	 * @param address the address to set
	 */
	public void setAddress(int address) {
		this.address = address;
	}

	public void setLength(int length) {
		assert(length > 0);
		this.length = length;
	}

	public int getLength() {
		return length;
	}

	public Instruction getInstruction(Assembler assembler, byte[] memory)
	{
		return assembler.dissambleData(memory, this);
	}
}
